const server="8080";
let [a, b, c] = [1, 2, 3];
let [x, y, z] = new Set(['a', 'b', 'c']);

let [h, i = 'b'] = ['a']; // x='a', y='b'
let [j, k = 'b'] = ['a', undefined]; // x='a', y='b'
let { foo, bar } = { foo: 'aaa', bar: 'bbb' };
const [f, g, l, d, e] = 'hello';
let fn = () => {
    let a = 0;
    console.log('我是箭头函数'+a);
}
function add([x, y]){
    return x + y;
}
  
add([1, 2]); // 3

let jsonData = {
    id: 42,
    status: "OK",
    data: [867, 5309]
};

let { id, status, data: number } = jsonData;

const map = new Map();
map.set('first', 'hello');
map.set('second', 'world');

for (let [key, value] of map) {
  console.log(key + " is " + value);
}

const tmpl = addrs => `
  <table>
  ${addrs.map(addr => `
    <tr><td>${addr.first}</td></tr>
    <tr><td>${addr.last}</td></tr>
  `).join('')}
  </table>
`;
const data = [
    { first: '<Jane>', last: 'Bond' },
    { first: 'Lars', last: '<Croft>' },
];

console.log(tmpl(data));